# coding:utf-8

'''
sqlite连接参照
'''

'''
# ========== sqlite DDL =========
# 创建数据库：cmd> sqlite3.exe sqlite_refer.db
# 数据库为空的话，没有db文件
# 创建表：sqlite> create table test(`name`,`age`);
# 创建表的时候可以不指定数据类型
'''

import sqlite3
import sys

db_file = '%s\\resource\\sqlite_refer.db' % sys.path[1]

connection = sqlite3.connect(db_file)

cursor = connection.cursor()
# sql = '''INSERT INTO test('name','age') VALUES ('seer',27)'''
# cursor.execute(sql)
# connection.commit()

content = cursor.execute('SELECT * FROM test')
print content.fetchall()
connection.close()
